package main

import (
	"fmt"
	"log"
	"net/http"
)

func indexRouter(w http.ResponseWriter, r *http.Request) {
	_, _ = fmt.Fprintf(w, "<h1>Hello World</h1>")
}

func healthRouter(w http.ResponseWriter, r *http.Request) {
	_, _ = fmt.Fprintf(w, "<h1>health check</h1>")
}

func main() {
	http.HandleFunc("/", indexRouter)
	http.HandleFunc("/health", healthRouter)

	err := http.ListenAndServe(":3000", nil)
	if err != nil {
		fmt.Println("http start error...")
		log.Fatal(err.Error())
	} else {
		fmt.Println("http start success...")
	}
}
